////////////////////////////////////////////////////
/// This file is part of Marstone Code Studio    ///
///    Copyright(c)2008 - 2008, Marstone Studio  ///
///           Author: marstone                   ///
///       Email: marstone@marstone.net           ///
///           Since: 2008/07/19                  ///
////////////////////////////////////////////////////


using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;
using Microsoft.JScript;
using mshtml;


namespace Studio.Network.Utilities
{

    public class JScripter
    {

        JScriptCodeProvider compiler = new JScriptCodeProvider();



        public JScripter(string source)
        {
            // new JScriptCodeProvider().CompileAssemblyFromSource(


        }

        /*
    BOOL         CAboutBox::ReplaceHtmlByID(LPCTSTR     lpszTagID,LPCTSTR   lpszHtml,BOOL   bIsInnerHtml)   
    {    
          CComDispatchDriver     pHTMLDispatch(m_wndBrowser.GetDocument());   
          if(pHTMLDispatch.p){   
                  HRESULT   hr;   
                  CComQIPtr<IHTMLDocument2,   &IID_IHTMLDocument2>   pHTMLDocument(pHTMLDispatch);     
                  if(pHTMLDocument.p){   
                          CComPtr<IHTMLElementCollection>   pHTMLElementCollection;   
                          hr=pHTMLDocument->get_all(&pHTMLElementCollection);   
                          if(hr==S_OK   &&     pHTMLElementCollection.p!=NULL){   
                                  LONG         celem;   
                                  hr=pHTMLElementCollection->get_length(&celem);   
                                  if(hr==S_OK){   
                                          for(int   i=0;i<celem;i++){   
                                                  COleVariant   varIndex,var2;//var2   is   not   used   because   accessing   index,not   name   
                                                  varIndex.vt=VT_UINT;   
                                                  varIndex.lVal=i;   
                                                  CComDispatchDriver     pDisp;   
                                                  hr=pHTMLElementCollection->item(varIndex,var2,&pDisp);   
                                                  if(hr==S_OK){   
                                                          CComQIPtr<IHTMLElement,   &IID_IHTMLElement>   pHTMLElement(pDisp);     
                                                          if(pHTMLElement){   
                                                                  //find   html   element   
                                                                  BSTR         bstrTagID;   
                                                                  if(pHTMLElement->get_id(&bstrTagID)==S_OK){   
                                                                          if(bstrTagID!=NULL){   
                                                                                  _bstr_t   bstrHTML(lpszHtml);   
                                                                                  _bstr_t   bstrTagIDToCompare(lpszTagID);   
                                                                                  _bstr_t   _bstrTagID(bstrTagID,FALSE);   
                                                                                  if(_bstrTagID==bstrTagIDToCompare){   
                                                                                          if(bIsInnerHtml)   
                                                                                                  pHTMLElement->put_innerHTML(bstrHTML);   
                                                                                          else   
                                                                                                  pHTMLElement->put_outerHTML(bstrHTML);   
                          #ifdef     _DEBUG   
                                                                                          BSTR         bstrTag;   
                                                                                          hr=pHTMLElement->get_outerHTML(&bstrTag);   
                                                                                          CString   strTag=bstrTag;   
                                                                                          ::afxDump<<strTag;   
                          #endif   
                                                                                  }   
                                                                          }   
                                                                  }   
                                                          }   
                                                  }   
                                          }   
                                  }   
                          }   
                  }   
          }   
          return   TRUE;   
  } 
    */
    }
}
